-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add python version actions #172
Conversation
WalkthroughThe pull request modifies the GitHub Actions workflow configuration file 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 99 99
=========================================
Hits 99 99
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/test.yml (1)
Line range hint
1-54
: Consider additional workflow improvementsWhile not directly related to the Python version changes, here are some suggestions to improve the workflow:
- Consider restricting the workflow to specific branches or adding
pull_request
trigger- Update other outdated actions:
actions/checkout@v2
→actions/checkout@v4
codecov/[email protected]
→codecov/codecov-action@v4
Apply these changes to update the actions:
- - uses: actions/checkout@v2 + - uses: actions/checkout@v4- uses: codecov/[email protected] + uses: codecov/codecov-action@v4🧰 Tools
🪛 actionlint (1.7.4)
25-25: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/test.yml
(2 hunks)
🔇 Additional comments (2)
.github/workflows/test.yml (2)
54-54
: LGTM! Token formatting looks good
The Codecov token is properly secured using GitHub secrets.
23-23
:
Review Python version compatibility and update action versions
There are several concerns with the current Python version matrix:
- Python 3.13 is not yet released and will cause CI failures
- Python 3.7 reached end-of-life (EOL) on June 27, 2023
- The
actions/setup-python
action is using an outdated version (v2.2.1)
Apply this diff to address these issues:
- python-version: [3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13]
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Also, update the action version in all jobs:
- uses: actions/[email protected]
+ uses: actions/setup-python@v5
Let's verify the Python version support in your project:
✅ Verification successful
Review Python version compatibility and update action versions
Based on the codebase analysis:
- The project uses features that require Python 3.6+ (f-strings)
- Uses typing features and Pydantic v1 (requires Python 3.6.1+)
- Dependencies indicate a stable environment:
- pytest 6.2.x
- pydantic 1.9.0
- mypy 0.790
Recommendations:
- Remove Python 3.7 as it's EOL
- Remove Python 3.13 as it's not released
- Keep Python 3.8 through 3.12
- Update actions/setup-python to v5
Apply this diff:
- python-version: [3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13]
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Also update the action version:
- uses: actions/[email protected]
+ uses: actions/setup-python@v5
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if there's any Python version constraint in setup.py or pyproject.toml
fd -e toml -e py -x grep -l "python_requires" {} \;
# Check for version-specific imports or syntax
rg -g '!.git' -g '*.py' "match.*case|match .*:|type.*annotations|ParamSpec|TypeVarTuple|assert.*type|Self"
Length of output: 163
Script:
#!/bin/bash
# Let's try a different approach to check Python version requirements
# Check setup.py if it exists
fd "setup.py$" -x cat {}
# Check pyproject.toml if it exists
fd "pyproject.toml$" -x cat {}
# Check for any requirements files
fd "requirements.*\.txt$" -x cat {}
# Look for type hints usage that might indicate minimum Python version
rg "from typing import" -g "*.py"
# Look for f-strings (Python 3.6+)
rg "f['\"]" -g "*.py"
# Look for async/await (Python 3.5+)
rg "async def|await " -g "*.py"
Length of output: 1379
1815e70
to
b956a61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
requirements-test.txt (1)
1-6
: Consider adding package constraintsGiven the expanded Python version support (3.7-3.13), consider using version ranges (e.g.,
>=7.4.4,<8.0.0
) instead of pinned versions to allow for compatible updates while preventing breaking changes.Example format:
-pytest==7.4.4 +pytest>=7.4.4,<8.0.0
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
requirements-test.txt
(1 hunks)
🔇 Additional comments (3)
requirements-test.txt (3)
3-4
: LGTM: Minor version updates for formatting tools
The updates to black (22.8.0) and isort (5.11.5) are minor version changes within their respective major versions, maintaining backward compatibility.
5-6
: Verify breaking changes in linting and type checking tools
The major version updates to flake8 (5.0.4) and mypy (1.4.1) might introduce breaking changes in linting rules and type checking behavior.
✅ Verification successful
Proceed with the version updates - no significant impact expected
The codebase has minimal type hint usage and no linter configuration files were found. The existing type hints are basic and stable across mypy versions:
- Simple return type annotations (
-> str
,-> bool
) - Basic type hints from
typing
module (Union[str, List[int]]
)
These patterns are well-established and supported across mypy versions. The flake8 update is also safe as there's no custom configuration that could be affected by rule changes.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for breaking changes in flake8 and mypy
# Search for any .flake8 or mypy configuration files
echo "Checking for linter configurations:"
fd -e .flake8 -e mypy.ini -e .mypy.ini
# Check Python files for potential type hints usage
echo "Checking for type hint usage that might be affected by mypy update:"
rg -l "typing\." -t py
# Check for common type annotation patterns
ast-grep --pattern 'def $_($_: $_) -> $_: $$$'
Length of output: 2470
1-2
: Verify pytest and pytest-cov compatibility
Both pytest and pytest-cov have undergone major version updates. While pytest 7.4.4 supports Python 3.7+ as intended, let's verify the compatibility matrix.
✅ Verification successful
Let me try another verification approach to check for compatibility issues.
✅ pytest and pytest-cov updates are compatible and safe
Based on the verification results:
- Both pytest 7.4.4 and pytest-cov 4.1.0 support Python >=3.7, which aligns with the project's requirements
- The test files use basic pytest features (imports and fixtures) that are stable across major versions
- The pytest configuration in setup.cfg uses standard pytest-cov options that are supported in both v2.x and v4.x
- No complex or deprecated pytest features are being used that could be affected by the version updates
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check compatibility between pytest, pytest-cov, and Python versions
# Check pytest compatibility info
curl -s https://pypi.org/pypi/pytest/7.4.4/json | jq -r '.info.requires_python'
# Check pytest-cov compatibility info
curl -s https://pypi.org/pypi/pytest-cov/4.1.0/json | jq -r '.info.requires_python'
# Check for any known issues between these versions
gh search issues "pytest 7.4.4 pytest-cov 4.1.0" --repo pytest-dev/pytest --repo pytest-dev/pytest-cov --state all
Length of output: 3008
Script:
#!/bin/bash
# Check for any test files that might be affected by the pytest version update
fd -e py "test_.*\.py|.*_test\.py" --exec head -n 20 {}
# Look for any pytest specific features or decorators in use
rg -l "@pytest\."
# Check for pytest-cov configuration in pytest.ini or setup.cfg
fd "pytest.ini|setup.cfg|pyproject.toml" --exec cat {}
Length of output: 1332
* Add python version actions * Update test.yml * update test deps --------- Co-authored-by: Felipe López <[email protected]>
* Add python version actions * Update test.yml * update test deps --------- Co-authored-by: Felipe López <[email protected]>
* Upgrade Python version requirements and dependencies - Updated Python version from 3.7 to 3.8 in Makefile and README.md. - Upgraded Pydantic dependency from 1.9.0 to 2.10.3 in requirements.txt and setup.py. - Updated mypy version from 0.790 to 1.13.0 in requirements-test.txt. - Refactored CLABE validation logic in types.py, removing custom error classes and integrating Pydantic's validation features. - Removed unused error handling code and updated tests to reflect changes in validation logic. - Updated GitHub Actions workflow to support Python versions 3.8 through 3.13. - Bumped version to 2.0.0.dev0 in version.py. * Update GitHub Actions workflow to use string format for Python versions * Update GitHub Actions workflow to include Python 3.13 in the testing * Add python version actions (#172) * Add python version actions * Update test.yml * update test deps --------- Co-authored-by: Felipe López <[email protected]> * Upgrade Python version requirements and dependencies - Updated Python version from 3.7 to 3.8 in Makefile and README.md. - Upgraded Pydantic dependency from 1.9.0 to 2.10.3 in requirements.txt and setup.py. - Updated mypy version from 0.790 to 1.13.0 in requirements-test.txt. - Refactored CLABE validation logic in types.py, removing custom error classes and integrating Pydantic's validation features. - Removed unused error handling code and updated tests to reflect changes in validation logic. - Updated GitHub Actions workflow to support Python versions 3.8 through 3.13. - Bumped version to 2.0.0.dev0 in version.py. * Changed regex to pattern in BankConfigRequest model * Update README; bump version to 2.0.0 * Update GitHub Actions workflow to remove Python 3.7 from the testing matrix, supporting versions 3.8 through 3.13. * This change enhances compatibility with Pydantic V2 and streamlines error handling. * Update setup.py to require Python 3.8 and bump version to 2.0.0 * Enhance README with Pydantic v2 usage examples and update CLABE validation logic * Fix code block formatting in README.md for Pydantic example * Removing redundant test case --------- Co-authored-by: gabino <[email protected]> Co-authored-by: Pach <[email protected]> Co-authored-by: Felipe López <[email protected]>
Summary by CodeRabbit
pytest
,pytest-cov
,black
,isort
,flake8
, andmypy
.